package com.jfinal.bbsapp.sysconfig;
import org.apache.log4j.Logger;
import com.jfinal.bbsapp.common.kit.MyAnnotation;
import com.jfinal.kit.Ret;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class SysConfigService {
	private final Logger logger = Logger.getLogger(SysConfigService.class);
	
	
	@MyAnnotation(memo="根据参数配置获取参数配置值")
	public Ret getval(String configcode) {
		try {
			Record data = Db.findFirst("select configcode,setval,memo from sys_config where configcode=?", configcode);
			return Ret.ok("data", data).set("code", 20000);
		} catch (Exception e) {
			logger.error("Exception:" , e);
			return Ret.fail("系统异常请稍后重试").set("code", 50000);
		}
	}
}